import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index.vue'
// 为了实现彻底懒加载所以在此就不要import除首页之外的页面文件

Vue.use(VueRouter)

const routes = [
  // 0.首页
  {
    path: '/',
    component: Index,
    meta: {
      title: '婚礼纪网站主页'
    }
  },
  // 懒加载的页面
  // 1.城市版首页
  {
    path: '/cityIndex',
    name: 'CityIndex',
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "CityIndex" */ '../views/CityIndex.vue'),
    meta: {
      title: '婚礼纪网站主页'
    }
  },
  // 2.登录页面
  {
    path: '/login',
    name: 'Login',
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "Login" */ '../views/Login.vue')
  },
  // 3.注册页面
  {
    path: '/register',
    name: 'Register',
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "Register" */ '../views/Register.vue')
  },
  // 4.电子请帖页面
  {
    path: '/invCard',
    name: 'InvCard',
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "InvCard" */ '../views/InvCard.vue')
  },
  // 5.旅拍套餐详情页
  {
    path: '/photo_meal/:meal_id',
    name: 'PhotoMeal',
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "PhotoMeal" */ '../views/PhotoMeal.vue')
  },
  // 6.视频请帖制作和展示页面组件
  {
    path: '/vedioMeal',
    name: 'VedioMeal',
    component: () => import(/* webpackChunkName: "VedioMeal" */ '../views/VedioMeal.vue')
  },
  // 7.测试文件上传的页面(不成功就先删除)
  {
    path: '/mine',
    name: 'Mine',
    component: () => import(/* webpackChunkName: "Mine" */ '../views/Mine.vue')
  },
  // 8.全国城市选择页面
  {
    path: '/chooseCity',
    name: 'ChooseCity',
    component: () => import(/* webpackChunkName: "ChooseCity" */ '../views/ChooseCity.vue')
  },
  // 苏凯的开始--------------------------------------------------------------------------------
  {
    path: "/picHome",
    name: 'PicHome',
    component: () => import(/* webpackChunkName: "PicHome" */ '../views/Pic_homePage.vue'),
    meta: {
      title: '美图模块'
    }
  },
  {
    path: "/picture/:homekeywords/:page",
    component: () => import(/* webpackChunkName: "Marry_Picture_homePage" */ '../views/Marry_Picture_homePage.vue'),
    props: true
  },
  {
    path: "/picturedetails/:homekeywords/:detailskeywords",
    component: () => import(/* webpackChunkName: "Marry_Picture_detailsPage" */ '../views/Marry_Picture_detailsPage.vue'),
    props: true
  },
  {
    path: "/picturelabel/:homekeywords/:searchlabelid",
    component: () => import(/* webpackChunkName: "Marry_Picture_labelPage" */ '../views/Marry_Picture_labelPage.vue'),
    props: true
  },
  {
    path: '/video',
    component: () => import(/* webpackChunkName: "Pic_Video_homepage" */ '../views/Pic_Video_homepage.vue'),
  },
  {
    path: '/videodetail/:vid',
    component: () => import(/* webpackChunkName: "Marry_Video_detailspage" */ '../views/Marry_Video_detailspage.vue'),
    props: true
  },
  // 苏凯的结束--------------------------------------------------------------------------------


  // 王瑞的开始--------------------------------------------------------------------------------
  {
    path: '/wrindex',
    component: () => import(/* webpackChunkName: "wrindex" */'../views/wrIndex.vue')
  },
  {
    path: "/hotcity",
    props: true,
    component: () => import(/* webpackChunkName: "HotCity" */
      '../views/HotCity.vue'
    )
  },
  {
    path: "/details", component: () => import(/* webpackChunkName: "details" */'../views/Details.vue')
  },
  {
    path: "/in_shop", props: true, component: () => import(/* webpackChunkName: "in_shop" */'../views/InShop.vue')
  },
  {
    path: "/out_shop", component: () => import(/* webpackChunkName: "out_shop" */'../views/OutShop.vue')
  },
  // 王瑞的结束--------------------------------------------------------------------------------


  // 雷耀的开始--------------------------------------------------------------------------------

  {
    path: '/detail/:hid',
    component: () => import(/* webpackChunkName: "detail" */
      '../views/detail.vue'
    ),
    props: true
  },

  {
    path: '/hotel',
    component: () => import(/* webpackChunkName: "hotel" */
      '../views/hotel.vue'
    )
  },
  {
    path: '/Reservation',
    component: () => import(/* webpackChunkName: "Reservation" */
      '../views/Reservation.vue'
    )
  },
  // 雷耀的结束--------------------------------------------------------------------------------
  // 袁子君的开始--------------------------------------------------------------------------------
  {
    path: '/strategyindex',
    name: 'StrategyIndex',
    component: () => import(/* webpackChunkName: "StrategyIndex" */
      '../views/StrategyIndex'
    )
  },
  {
    path: '/list/:cate',
    props: true,
    component: () => import(/* webpackChunkName: "list" */
      '../views/Strategylist'
    )
  },
  {
    path: '/scontent/:id',
    props: true,
    component: () => import(/* webpackChunkName: "scontent" */
      '../views/StrategyContent'
    )
  },
  // 袁子君的结束--------------------------------------------------------------------------------

  // 贾宇的婚品商城开始--------------------------------------------------------------------------
  {
    path: '/shoppingindex',
    name: 'Shopping_index',
    component: () => import(/* webpackChunkName: "Shopping_index" */
      '../views/Shopping_index'
    )
  },
  {
    path: '/shoppingcategory',
    name: 'Shopping_category',
    component: () => import(/* webpackChunkName: "Shopping_category" */
      '../views/Shopping_category'
    )
  },
  {
    path: '/shoppinglist/:lid',
    props:true,
    name: 'Shopping_list',
    component: () => import(/* webpackChunkName: "Shopping_list" */
      '../views/Shopping_list'
    )
  },
  // 贾宇的婚品商城结束--------------------------------------------------------------------------

  // 404页面
  {
    path: '/404',
    name: '404',
    component: () => import(/* webpackChunkName: "404" */'../views/404')
  },

  {
    path: '*',
    redirect: {
      name: "404"
    }
  }
]

const router = new VueRouter({
  routes,
  scrollBehavior(to, from, savedPosition) { // 解决vue页面之间跳转，页面不是在顶部的问题
    return { x: 0, y: 0 }
  },
});


export default router
